package com.moxiao.yfjh.module.activity.dal.mysql.activityPackage;

import java.util.*;

import com.moxiao.yfjh.framework.common.pojo.PageResult;
import com.moxiao.yfjh.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.moxiao.yfjh.framework.mybatis.core.mapper.BaseMapperX;
import com.moxiao.yfjh.module.activity.dal.dataobject.activityPackage.ActivityPackageDO;
import org.apache.ibatis.annotations.Mapper;
import com.moxiao.yfjh.module.activity.controller.admin.activityPackage.vo.*;

/**
 * 相亲活动套餐信息 Mapper
 *
 * @author mx
 */
@Mapper
public interface ActivityPackageMapper extends BaseMapperX<ActivityPackageDO> {

    default PageResult<ActivityPackageDO> selectPage(ActivityPackagePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ActivityPackageDO>()
                .eqIfPresent(ActivityPackageDO::getActiveId, reqVO.getActiveId())
                .eqIfPresent(ActivityPackageDO::getProductId, reqVO.getProductId())
                .eqIfPresent(ActivityPackageDO::getMerchantId, reqVO.getMerchantId())
                .eqIfPresent(ActivityPackageDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(ActivityPackageDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ActivityPackageDO::getId));
    }

    default List<ActivityPackageDO> selectList(ActivityPackageExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<ActivityPackageDO>()
                .eqIfPresent(ActivityPackageDO::getActiveId, reqVO.getActiveId())
                .eqIfPresent(ActivityPackageDO::getMerchantId, reqVO.getMerchantId())
                .eqIfPresent(ActivityPackageDO::getProductId, reqVO.getProductId())
                .eqIfPresent(ActivityPackageDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(ActivityPackageDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ActivityPackageDO::getId));
    }

}
